package com.yangyang.rpc.core.netcom.common.client;

import com.yangyang.rpc.core.netcom.common.bean.RpcRequest;
import com.yangyang.rpc.core.netcom.common.bean.RpcResponse;
import com.yangyang.rpc.core.serialize.Serializer;

/**
 * 抽象客户端
 * Created by chenshunyang on 2016/11/19.
 */
public abstract class AbstractClient {

    protected String serverAddress;
    protected Serializer serializer;
    protected long timeoutMillis;

    public abstract RpcResponse send(RpcRequest request) throws Exception;

    public  void init(String serverAddress, Serializer serializer, long timeoutMillis){
        this.serverAddress = serverAddress;
        this.serializer = serializer;
        this.timeoutMillis = timeoutMillis;
    }
}
